﻿using System.Diagnostics;

namespace DimensionsHelper.LanguageService.Syntax;

// usagetype ( "<usage-type-value> (, <usage-type-value> )* " )
public class MetadataUsageType : MetadataSingleArgumentSuffix<StringLiteral>
{
    internal MetadataUsageType(SyntaxToken usageTypeKeywordToken, SyntaxNode? parent) :
        base(SyntaxKinds.MetadataUsageType,
            usageTypeKeywordToken,
            NodeConverter.ToIdentifier(usageTypeKeywordToken),
            parent)
    {
    }
}


public static partial class NodeFactory
{
    public static MetadataUsageType CreateMetadataUsageType(SyntaxNode? parent, SyntaxToken usageTypeKeyword,
        StringLiteral? value)
    {
        Debug.Assert(usageTypeKeyword.IsNode(SyntaxKinds.UsageTypeKeywordToken));
        MetadataUsageType usageType = new(usageTypeKeyword, parent);
        return UpdateMetadataSingleArgumentSuffix(usageType, value);
    }
}